#!/bin/bash

cat >> /etc/hosts << EOF
172.16.36.10 node1
172.16.36.11 node2
172.16.36.12 master1
EOF

yum install -y chrony
sed -i 's/^server/#&/' /etc/chrony.conf
cat >> /etc/chrony.conf << EOF
server 0.asia.pool.ntp.org iburst
server 1.asia.pool.ntp.org iburst
server 2.asia.pool.ntp.org iburst
server 3.asia.pool.ntp.org iburst
allow all
EOF

systemctl enable chronyd && systemctl restart chronyd

timedatectl set-ntp true